import axios from 'axios'
import { ElMessageBox } from 'element-plus';

const _axios = axios.create({
  baseURL: 'http://192.168.176.55:8088'
})
export const request = (url,method,params,callback) => {
  _axios({
    url:url,
    method:method,
    params:params,
	data:params
  }).then(response => {
    callback(response.data)
  }).catch(error => {
      ElMessageBox.alert(error.message, '提示', {
        type: 'error'
      })
  })
}
export const get = (url,params,callback) => {

  request(url, 'get', params, callback)
}
export const post = (url,params,callback) => {
  request(url, 'post', params, callback)
}